package com.hand.qt24953.service.Impl;

import com.hand.qt24953.bean.User;
import com.hand.qt24953.mapper.UserMapper;
import com.hand.qt24953.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author qiutao
 * @date 2019/7/17
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    public Long insertUser(User user) {
        userMapper.insertUser(user);
        return user.getUserId();
    }

    @Override
    public int updateUser(User user) {
        user.setLastUpdateDate(new Date());
        user.setLastUpdatedBy(1L);
        return userMapper.updateUser(user);
    }

    @Override
    public int deleteUser(Long userId) {
        return userMapper.deleteUser(userId);
    }
}
